package main.java.observer1;

import java.util.LinkedList;

/**
 * @author xin麒
 * @date 2023/2/8 19:07
 */
public class Author {
    private LinkedList<Shop> shops = new LinkedList<>();
    public void addShop(Shop shop){
        shops.add(shop);
    }
    public void removeShop(Shop shop){
        shops.remove(shop);
    }

    public void notifyShop(String price){
        System.out.println("=====最新通知=====");
        for (Shop shop :shops) {
            shop.updatePrice(price);
        }

    }
}
